/*
 * @Description: 视频播放
 * @Author: Wang ZhongWang
 * @Date: 2022-03-20 10:11:35
 * @LastEditTime: 2023-03-20 14:40:10
 * @LastEditors: Wang ZhongWang
 */
import request from '@/utils/request'

/**
 * 子设备分页查询
 * @param query
 */
export function playVideo(query) {
  var params = JSON.parse(JSON.stringify(query))
  return request({
    url: '/iot/play/start',
    method: 'get',
    params: params
  })
}

/**
 * 抓图
 * @param flvUrl
 */
export function getSnap(flvUrl) {
  var params = JSON.parse(JSON.stringify(flvUrl))
  return request({
    url: '/iot/play/getSnap',
    method: 'get',
    params: params,
    responseType: 'blob'
  })
}

/**
 * 云台控制
 * @param query
 */
export function ptzControl(query) {
  var params = JSON.parse(JSON.stringify(query))
  return request({
    url: '/iot/ptz/ptzCamera',
    method: 'get',
    params: params
  })
}

/**
 * 设备录像
 * @param query
 */
export function queryRecords(query) {
  var params = JSON.parse(JSON.stringify(query))
  return request({
    url: '/iot/record/recordInfo',
    method: 'get',
    params: params
  })
}

/**
 * 设备录像播放
 * @param query
 */
export function playRecord(query) {
  var params = JSON.parse(JSON.stringify(query))
  return request({
    url: '/iot/playback/start',
    method: 'get',
    params: params
  })
}

